package avicit.bdp.dms.das.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import avicit.platform6.core.properties.PlatformConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2020-07-30 18:06
 * @类说明：bdp_das_stat
 * @修改记录：
 */
@ApiModel(value = "BdpDasStatDTO", description = "bdp_das_stat")
@Table(name = "bdp_das_stat")
public class BdpDasStatDTO extends BaseDTO {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Id
    @LogField
    @ApiModelProperty(value = "id", name = "id")
    @FieldRemark(column = "id", field = "id", name = "主键")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 统计日期
     */
    @LogField
    @ApiModelProperty(value = "统计日期", name = "statisticsDate")
    @FieldRemark(column = "statistics_date", field = "statisticsDate", name = "统计日期")
    @Column(name = "statistics_date")
    private String statisticsDate;

    /**
     * 数据源数
     */
    @LogField
    @ApiModelProperty(value = "数据源数", name = "datasourceCount")
    @FieldRemark(column = "datasource_count", field = "datasourceCount", name = "数据源数")
    @Column(name = "datasource_count")
    private Long datasourceCount;

    /**
     * 模型数量
     */
    @LogField
    @ApiModelProperty(value = "模型数量", name = "modelCount")
    @FieldRemark(column = "model_count", field = "modelCount", name = "模型数量")
    @Column(name = "model_count")
    private Long modelCount;

    /**
     * 数据湖数据数
     */
    @LogField
    @ApiModelProperty(value = "数据湖数据数", name = "lakeDataCount")
    @FieldRemark(column = "lake_data_count", field = "lakeDataCount", name = "数据湖数据数")
    @Column(name = "lake_data_count")
    private Long lakeDataCount;

    /**
     * 数据湖表数
     */
    @LogField
    @ApiModelProperty(value = "数据湖表数", name = "lakeTableCount")
    @FieldRemark(column = "lake_table_count", field = "lakeTableCount", name = "数据湖表数")
    @Column(name = "lake_table_count")
    private Long lakeTableCount;

    /**
     * 数据湖文件数
     */
    @LogField
    @ApiModelProperty(value = "数据湖文件数", name = "lakeFileCount")
    @FieldRemark(column = "lake_file_count", field = "lakeFileCount", name = "数据湖文件数")
    @Column(name = "lake_file_count")
    private Long lakeFileCount;


    @Transient
    private String lakeDataCountStr;

    public String getLakeDataCountStr() {
        return lakeDataCountStr;
    }

    public void setLakeDataCountStr(String lakeDataCountStr) {
        this.lakeDataCountStr = lakeDataCountStr;
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getStatisticsDate() {
        return statisticsDate;
    }

    public void setStatisticsDate(String statisticsDate) {
        this.statisticsDate = statisticsDate;
    }

    public Long getDatasourceCount() {
        return datasourceCount;
    }

    public void setDatasourceCount(Long datasourceCount) {
        this.datasourceCount = datasourceCount;
    }

    public Long getModelCount() {
        return modelCount;
    }

    public void setModelCount(Long modelCount) {
        this.modelCount = modelCount;
    }

    public Long getLakeDataCount() {
        return lakeDataCount;
    }

    public void setLakeDataCount(Long lakeDataCount) {
        this.lakeDataCount = lakeDataCount;
    }

    public Long getLakeTableCount() {
        return lakeTableCount;
    }

    public void setLakeTableCount(Long lakeTableCount) {
        this.lakeTableCount = lakeTableCount;
    }

    public Long getLakeFileCount() {
        return lakeFileCount;
    }

    public void setLakeFileCount(Long lakeFileCount) {
        this.lakeFileCount = lakeFileCount;
    }

    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "数据统计模块";
        } else {
            return super.logFormName;
        }
    }

    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "数据统计";
        } else {
            return super.logTitle;
        }
    }

    public PlatformConstant.LogType getLogType() {
        if (super.logType == null) {
            return PlatformConstant.LogType.module_operate;
        } else {
            return super.logType;
        }
    }

}
